Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added configuration to disable optimisticCast for Date, Time and Date… #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

computate
Copy link

The optimisticCast method is problematic when inserting Date values into a text or char field in the database, converting a parameter like '2019-08-16' to '2019-08-16 -06' with the timezone offset. I am submitting a pull request to enable or disable the optimisticCast for Date, Time and DateTime.

@computate
Copy link
Author

Hello team! Any chance I can get a review on this pull request to fix this database bug that could be affecting any vertx clients, @pmlopes or others?

@gpg0
Copy link

gpg0 commented Aug 28, 2019

This issue is also affecting me, any chance of merging this patch soon?

@computate
Copy link
Author

Thanks for the thumbs up @pasku . Once this is merged, you would be able to resolve these issues by configuring your JDBC connection like this:
JsonObject jdbcConfig = new JsonObject();
jdbcConfig.put("url", configSite.getJdbcUrl());
jdbcConfig.put("driver_class", configSite.getJdbcClassePilote());
jdbcConfig.put("user", configSite.getJdbcUtilisateur());
jdbcConfig.put("password", configSite.getJdbcMotDePasse());
jdbcConfig.put("max_pool_size", configSite.getJdbcTailleMaxPiscine());
jdbcConfig.put("initial_pool_size", configSite.getJdbcTailleInitialePiscine());
jdbcConfig.put("min_pool_size", configSite.getJdbcTailleMinPiscine());
jdbcConfig.put("max_statements", configSite.getJdbcMaxDeclarations());
jdbcConfig.put("max_statements_per_connection", configSite.getJdbcMaxDeclarationsParConnexion());
jdbcConfig.put("max_idle_time", configSite.getJdbcTempsInactiviteMax());
jdbcConfig.put("castUUID", false);
jdbcConfig.put("castDateTime", false);
jdbcConfig.put("castTime", false);
jdbcConfig.put("castDate", false);
jdbcClient = JDBCClient.createShared(vertx, jdbcConfig);
jdbcClient.getConnection(a -> {
if (a.failed()) {
LOGGER.error("Impossible d'ouvrir la connexion du client de base de données. ", a.cause());
future.fail(a.cause());
} else {
LOGGER.info("La connexion du client de base de données a réussi. ");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants